<!DOCTYPE html>
<html>
<head>
    <title>代理商</title>
    <#include "/header.html">
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <div class="grid-btn">
            <div class="form-group col-sm-2">
                <input type="text" class="form-control" v-model="q.shopName" @keyup.enter="query" placeholder="代理商名称">
            </div>
            <div class="form-group col-sm-2">
                <input type="text" class="form-control" v-model="q.shopPhone" @keyup.enter="query" placeholder="手机号码">
            </div>
            <a class="btn btn-primary" @click="query">查询</a>
    </div>
<table id="jqGrid"></table>
<div id="jqGridPager"></div>
</div>

<div v-show="!showList" class="panel panel-default">
    <div class="panel-heading">{{title}}</div>
    <form class="form-horizontal">
        <div class="form-group">
            <div class="col-sm-2 control-label">代理商名称</div>
            <div class="col-sm-10">
                <input type="text" class="form-control" v-model="agent.shopName" placeholder="代理商名称"/>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">代理商手机</div>
            <div class="col-sm-10">
                <input type="text" class="form-control" v-model="agent.shopPhone" placeholder="代理商手机"/>
            </div>
        </div>
        <!--<div class="form-group">-->
        <!--<div class="col-sm-2 control-label">代理模式 0 购买设备 1 投放设备</div>-->
        <!--<div class="col-sm-10">-->
        <!--<input type="text" class="form-control" v-model="agent.shopType" placeholder="代理模式 0 购买设备 1 投放设备"/>-->
        <!--</div>-->
        <!--</div>-->
        <div class="form-group">
            <div class="col-sm-2 control-label">代理模式</div>
            <label class="radio-inline">
                <input type="radio" name="status" value="0" v-model="agent.shopType" checked="checked"/> 购买设备
            </label>
            <label class="radio-inline">
                <input type="radio" name="status" value="1" v-model="agent.shopType"/> 投放设备
            </label>
        </div>
        <!--<div class="form-group">-->
        <!--<div class="col-sm-2 control-label">代理商上级</div>-->
        <!--<div class="col-sm-10">-->
        <!--<input type="text" class="form-control" v-model="agent.shopParent" placeholder="代理商上级"/>-->
        <!--</div>-->
        <!--</div>-->
        <div class="form-group">
            <div class="col-sm-2 control-label">代理商上级</div>
            <div >

            </div>
            <div style="vertical-align: middle;display: table-cell!important;">
                <div id="agentParent" style="float: left" class="col-sm-10">
                    <input type="text" class="form-control" disabled="disable" v-model="agent.shopParent"/>
                </div>
                <div class="col-sm-2">
                    <a class="btn btn-primary"  @click="addAgent">&nbsp;选择</a>
                </div>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">佣金百分比</div>
            <div class="col-sm-10">
                <input type="text" class="form-control" v-model="agent.shopRatio" placeholder="佣金百分比"/>
            </div>
        </div>
        <!--<div class="form-group">-->
        <!--<div class="col-sm-2 control-label">0 可打开所属机柜 1 不可打开</div>-->
        <!--<div class="col-sm-10">-->
        <!--<input type="text" class="form-control" v-model="agent.isopen" placeholder="0 可打开所属机柜 1 不可打开"/>-->
        <!--</div>-->
        <!--</div>-->
        <div class="form-group">
            <div class="col-sm-2 control-label">可打开所属机柜</div>
            <div class="col-sm-10">
                <select class="form-control" v-model="agent.isopen" @keyup.enter="query" >
                    <option value="0">是</option>
                    <option value="1">否</option>
                </select>
            </div>
        </div>
        <!--<div class="form-group">-->
        <!--<div class="col-sm-2 control-label">所属系统</div>-->
        <!--<div class="col-sm-10">-->
        <!--<input type="text" class="form-control" v-model="agent.sysSystem" placeholder="所属系统"/>-->
        <!--</div>-->
        <!--</div>-->
        <!--<div class="form-group">-->
        <!--<div class="col-sm-2 control-label">状态 0 正常 1 禁用</div>-->
        <!--<div class="col-sm-10">-->
        <!--<input type="text" class="form-control" v-model="agent.status" placeholder="状态 0 正常 1 禁用"/>-->
        <!--</div>-->
        <!--</div>-->
        <div class="form-group">
            <div class="col-sm-2 control-label">状态</div>
            <div class="col-sm-10">
                <select class="form-control" v-model="agent.status" @keyup.enter="query" >
                    <option value="0">正常</option>
                    <option value="1">禁用</option>
                </select>
            </div>
        </div>
        <!--<div class="form-group">-->
        <!--<div class="col-sm-2 control-label">备注</div>-->
        <!--<div class="col-sm-10">-->
        <!--<input type="text" class="form-control" v-model="agent.remarks" placeholder="备注"/>-->
        <!--</div>-->
        <!--</div>-->
        <!--<div class="form-group">-->
        <!--<div class="col-sm-2 control-label">创建时间</div>-->
        <!--<div class="col-sm-10">-->
        <!--<input type="text" class="form-control" v-model="agent.createdTime" placeholder="创建时间"/>-->
        <!--</div>-->
        <!--</div>-->
        <div class="form-group">
            <div class="col-sm-2 control-label">登录密码</div>
            <div class="col-sm-10">
                <input type="text" class="form-control" v-model="agent.loginPassword" placeholder="登录密码"/>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label"></div>
            <input type="button" class="btn btn-primary" id="btnSaveOrUpdate" data-loading-text="保存中..." @click="saveOrUpdate" value="确定"/>
            &nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>

            <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
                <div class="modal-dialog" role="document">
                    <form class="form-horizontal">
                        <div class="modal-content" style="width: 750px;">
                            <div style="padding: 15px;">
                                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                                <div style="padding: 20px 0;border-bottom: 1px solid #E2E5ED;">
                                    <p style="font-size: 14px;color: #4c4948;float: left;margin: 0!important;">选择代理商</p>
                                </div>
                            </div>
                            <div class="modal-body">
                                <div style="margin-bottom: 15px">
                                    <div style="float: left;margin-left:10px;height:34px;line-height:34px;">代理商状态：</div>
                                    <div style="float: left;width:70px;margin-right: 10px;">
                                        <select class="form-control" v-model="qcx.status" @keyup.enter="queryAgent" id="s_id">
                                            <option value="0">正常</option>
                                            <option value="1">异常</option>
                                        </select>
                                    </div>

                                    <div style="float: left;margin-left:10px;height:34px;line-height:34px;">代理商名称：</div>
                                    <div style="float: left;width:120px;margin-right: 10px;">
                                        <input type="text" class="form-control" v-model="qcx.shopName" @keyup.enter="queryAgent" placeholder="请输入内容">
                                    </div>
                                    <div style="float: left;margin-left:10px;height:34px;line-height:34px;">手机号码：</div>
                                    <div style="float: left;width:120px;margin-right: 10px;">
                                        <input type="text" class="form-control" v-model="qcx.shopPhone" @keyup.enter="queryAgent" placeholder="请输入内容">
                                    </div>

                                    <a class="btn btn-primary" @click="queryAgent">搜索</a>
                                </div>

                                <table id="jqGridAdd" style="width: 100%;"></table>
                                <div id="jqGridPager1"></div>
                                <!--<a class="btn btn-primary" @click="showAgent" style="margin-left: 290px;margin-top: 10px">确定</a>-->
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </form>
</div>

    <!-- 业务员弹窗 -->
    <div class="modal fade" id="myModalYWY" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
        <div class="modal-dialog" role="document">
            <form class="form-horizontal">
                <div class="modal-content" style="width: 750px;">
                    <div style="padding: 15px;">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                        <div style="padding: 20px 0;border-bottom: 1px solid #E2E5ED;">
                            <p style="font-size: 14px;color: #4c4948;float: left;margin: 0!important;">业务员信息</p>
                        </div>
                    </div>
                    <div class="modal-body">
                        <div style="margin-bottom: 15px">

                            <div style="float: left;margin-left:10px;height:34px;line-height:34px;">业务员名称：</div>
                            <div style="float: left;width:120px;margin-right: 10px;">
                                <input type="text" class="form-control" v-model="ywyxz.busName" @keyup.enter="queryAdminXZ" placeholder="请输入内容">
                            </div>
                            <div style="float: left;margin-left:10px;height:34px;line-height:34px;">手机号码：</div>
                            <div style="float: left;width:120px;margin-right: 10px;">
                                <input type="text" class="form-control" v-model="ywyxz.busPhone" @keyup.enter="queryAdminXZ" placeholder="请输入内容">
                            </div>

                            <a class="btn btn-primary" @click="querySale">搜索</a>
                        </div>

                        <table id="jqGridAddYWY" style="width: 100%;"></table>
                        <div id="jqGridPagerYWY" style="width: 100%;"></div>
                    </div>
                </div>
            </form>
        </div>
    </div>

    <!-- 代理商统计 -->
    <div class="modal fade" id="myModaldls" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
        <div class="modal-dialog" role="document">
            <form class="form-horizontal">
                <div class="modal-content" style="width: 750px;">
                    <div style="padding: 15px;">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                        <div style="padding: 20px 0;border-bottom: 1px solid #E2E5ED;">
                            <p style="font-size: 14px;color: #4c4948;float: left;margin: 0!important;">代理商订单统计</p>
                        </div>
                    </div>
                    <div class="modal-body">
                        <div style="margin-bottom: 15px">

                            <div style="float: left;margin-left:10px;height:34px;line-height:34px;">订单编号：</div>
                            <div style="float: left;width:120px;margin-right: 10px;">
                                <input type="text" class="form-control" v-model="dlstj.orderSn" @keyup.enter="queryAdminXZ" placeholder="请输入内容">
                            </div>

                            <a class="btn btn-primary" @click="queryAgentTj">搜索</a>
                        </div>

                        <table id="jqGridAdddls" style="width: 100%;"></table>
                        <div id="jqGridPagerdls" style="width: 100%;"></div>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>

<script src="${request.contextPath}/statics/js/modules/sys/agent.js?_${.now?long}"></script>
</body>
</html>